import Vue from 'vue'
import Router from 'vue-router'
// import Layout from '../layout/index'

Vue.use(Router)

export const constantRouterMap = [{
    path: '/',
    name: "home",
    component: () =>
      import ("@/views/home"),
    meta: { title: '首页', }
  },
  {
    path: '/login',
    name: "login",
    component: () =>
      import ("@/views/index/login.vue"),
    meta: { title: '登录', }
  },
  {
    path: '/addform',
    name: "addform",
    component: () =>
      import ("@/views/addform/index.vue"),
    meta: { title: '表单', }
  },

  {
    path: '/greenCard',
    name: "greenCard",
    component: () =>
      import ("@/views/index/greenCard.vue"),
    meta: { title: '绿卡', }
  },
  {
    path: '/notice',
    name: "notice",
    component: () =>
      import ("@/views/index/notice.vue"),
    meta: { title: '公告', }
  },
  {
    path: '/pendingApproval',
    name: "pendingApproval",
    component: () =>
      import ("@/views/index/pendingApproval.vue"),
    meta: { title: '待审批', }
  },
  {
    path: '/myHandled',
    name: "myHandled",
    component: () =>
      import ("@/views/index/myHandled.vue"),
    meta: { title: '我经手的', }
  },
  {
    path: '/Approved',
    name: "Approved",
    component: () =>
      import ("@/views/index/Approved.vue"),
    meta: { title: '已审批', }
  },
  {
    path: '/serviceCard',
    name: "serviceCard",
    component: () =>
      import ("@/views/index/serviceCard.vue"),
    meta: { title: '服务卡', }
  },
  {
    path: '/query',
    name: "query",
    component: () =>
      import ("@/views/addform/query.vue"),
    meta: { title: '查询', }
  },
  {
    path: '/largeOrderDiscount',
    name: "largeOrderDiscount",
    component: () =>
      import ("@/views/index/largeOrderDiscount.vue"),
    meta: { title: '大单优惠', }
  },
]

export default new Router({
  mode: 'hash',
  // mode: 'history',
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
})
